# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=libharu
pkgver=2.4.3
pkgrel=0
pkgdesc="C library for generating PDF documents"
url="https://github.com/libharu/libharu"
arch="all"
license="custom"
depends_dev="libpng-dev"
makedepends="$depends_dev cmake samurai"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/libharu/libharu/archive/v$pkgver/libharu-$pkgver.tar.gz
	soversion.patch
	"
options="!check" # no tests

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DLIBHPDF_STATIC=OFF
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/libharu/LICENSE"

	# remove useless files
	rm -rf "$pkgdir"/usr/share/libharu
}

sha512sums="
4b01dd0d23bdcaec6f69fe5f059902e7f49eafdf19d53d4cce8b4d52a54b2057b764de29390f4da9e75aeb32cb6af8606b23478b04edf9f7dcb1e4b769c5fff2  libharu-2.4.3.tar.gz
8e65e377c17a6c2471c1302ff3be9f1e685ae5a63e202aff16006e2560046603e770a640f4b0f25046573e54e75142b7546393bd0cfa4e9da38e9aa3053f848d  soversion.patch
"
